# Maintainer: Bruno Pagani <archange@archlinux.org>
# Contributor: Andrzej Giniewicz <gginiu@gmail.com>
# Contributor: Oliver Sherouse <oliver DOT sherouse AT gmail DOT com>

pkgname=python-seaborn
pkgver=0.12.2
pkgrel=3
pkgdesc="Statistical data visualization"
arch=(any)
url="https://seaborn.pydata.org/"
license=(BSD)
depends=(python-pandas python-matplotlib)
makedepends=(python-build python-installer python-flit-core)
optdepends=('python-scipy: clustering matrices and some advanced options'
            'python-statsmodels: advanced regression plots')
checkdepends=(python-pytest python-scipy python-statsmodels)
source=(https://github.com/mwaskom/seaborn/archive/v$pkgver/$pkgname-$pkgver.tar.gz
        https://github.com/mwaskom/seaborn/commit/db7ae117.patch)
sha256sums=('e11b9b136b583bbbb8b692dcd23ec539ea58c0325f7502cd049392352b815788'
            '17b591c70d063e6c32805ac06afee557464978a0c24924a90014b659bab187da')

prepare() {
  patch -d seaborn-$pkgver -p1 < db7ae117.patch # Fix test with matplotlib 3.7
}

build() {
  cd seaborn-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd seaborn-$pkgver
  pytest -vv --color=yes
}

package() {
  cd seaborn-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE.md -t "$pkgdir"/usr/share/licenses/$pkgname/
}
